<?php 
include '../include/init.php';
include '../include/common.fun.php';
include '../include/mysql.config.php';

islogin();

if($_POST){
	$title = $_POST['title'];
	$url = $_POST['url'];
	$order = $_POST['order']?$_POST['order']:0;
	// $content = $_POST['editorValue'];
	$arr = array(
			'par_name' => $title,
			'par_order' => $order,
			'par_url'=>$url,
			'par_addtime' => time()
		);
	if($_FILES){
		$res1 = upload('img1','../uploads/partner');
		$arr['par_img'] = $res1['path'];

		$result = $db->insert('wd_partner',$arr);
		if($result){
			alert('添加成功','partner_list.php');exit;
		}else{
			alert('添加失败');exit;
		}
	}
}



include "view/partner_add.php";
